import static org.junit.Assert.*;

import java.util.ArrayList;
import java.util.List;

import org.junit.Test;


public class IDSTest 
{
	//private IDS ds = new DS_JSON("e:/tt.json");
	//private IDS ds = new DS_Mock("");
	private IDS ds = new DS_DB("");

	@Test
	public void test0()
	{
		List<Person> orig = new ArrayList<Person>();
		ds.Save(orig);
		List<Person> real = ds.Load();
		assertTrue( orig.equals( real ) );
	}

	@Test
	public void test1() 
	{
		List<Person> orig = new ArrayList<Person>();
		orig.add( new Person(10,"ddd", "zzz", 25) );
		ds.Save(orig);
		List<Person> real = ds.Load();
		assertTrue( orig.equals( real ) );
	}

	@Test
	public void testN() 
	{
		List<Person> orig = new ArrayList<Person>();
		orig.add( new Person(10,"ddd", "zzz", 25) );
		orig.add( new Person(11,"dgg", "zrz", 25) );
		orig.add( new Person(12,"yyy", "zzz", 25) );
		orig.add( new Person(13,"666", "zbz", 25) );
		orig.add( new Person(14,"nnn", "zzz", 25) );
		ds.Save(orig);
		List<Person> real = ds.Load();		
		assertTrue( orig.equals( real ) );
	}
}
